// https://nuxt.com/docs/api/configuration/nuxt-config
import { createSvgIconsPlugin } from 'vite-plugin-svg-icons'
import path from 'path'

export default defineNuxtConfig({
  ssr: true,
  devtools: { enabled: true },
  
  app: {
    head: {
      title: 'Download Latest APK Installer',
      meta: [
        { name: 'description', content: 'Discover safe and reliable APK downloads for Android apps & games on APK Download Zone. Access free, fast downloads of the latest and historical versions, no registration required, with multi-device compatibility checks.' }
      ],
      link: [
        { rel: 'icon', type: 'image/x-icon', href: '/favicon.ico' },
        { rel: 'canonical', href: 'https://apkdownloadzone.com' }
      ]
    }
  },

  modules: ['@element-plus/nuxt'],

  css: [
    '~/assets/styles/main.scss',
  ],

  elementPlus: {
    importStyle: 'css',
    themes: ['dark'],
    components: ['ElDrawer', 'ElIcon']
  },

  vite: {
    build: {
      cssCodeSplit: false,
      chunkSizeWarningLimit: 5000
    },
    plugins: [
      createSvgIconsPlugin({
        iconDirs: [path.resolve(process.cwd(), 'assets/svg')]
      })
    ],
    css: {
      preprocessorOptions: {
        scss: {
          additionalData: `@use "~/assets/styles/mixins.scss" as *;`
        }
      }
    }
  },

  nitro: {
    preset: 'node-server',
    publicAssets: [
      {
        dir: 'public',
        baseURL: '/'
      }
    ],
    logLevel: 'debug'
  },

  components: {
    dirs: [
      {
        path: '~/components',
        global: true
      }
    ]
  },

  compatibilityDate: '2024-11-01'
})